//
//  LKAddEmployeerViewController.m
//  Mideleague_Agent
//
//  Created by Zhiwang on 2020/6/10.
//  Copyright © 2020 Zhiwang. All rights reserved.
//

#import "LKAddEmployeerViewController.h"
#import "LKAddRoleViewController.h"
@interface LKAddEmployeerViewController ()
@property(nonatomic,strong)UFFormView *formView;
@end

@implementation LKAddEmployeerViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    WS(weakSelf)
    self.navigationItem.title = @"新增员工";
    self.formView = [UFFormView makeFormView:^(UFFormViewMaker * _Nonnull make) {
        make
        .addSection([UFSection makeSection:^(UFSectionMaker * _Nonnull make) {
            make
            .titleStyle([UFRowTitleStyle makeTitleStyle:^(UFRowTitleStyleMaker * _Nonnull make) {
               make
                .font([UIFont fontWithName:@"PingFangSC-Regular" size:16])
                .color(labelBlackColor)
                .textAlignment(NSTextAlignmentLeft);
            }])
            .valueStyle([UFTextStyle makeTextStyle:^(UFRowTextStyleMaker * _Nonnull make) {
                make
                .textAlignment(NSTextAlignmentRight)
                .font([UIFont fontWithName:@"PingFangSC-Regular" size:16])
                .color(labelBlackColor);
                
            }])
            .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                make
                .height(RowHeightDefault)
                .title(@"角色")
                .name(@"merchant_name")
                .accessoryType(UFRowAccessoryDisclosureIndicator)
                .rowDidSelected(^(__kindof UFRow * _Nonnull row) {
                    LKAddRoleViewController *roleVc = [[LKAddRoleViewController alloc] init];
                    [weakSelf.navigationController pushViewController:roleVc animated:YES];
                })
                .value(@"");
            }])
            .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                make
                .height(RowHeightDefault)
                .title(@"姓名")
                .name(@"user_phone")
                .value(@"");
            }])
            .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                make
                .height(RowHeightDefault)
                .title(@"手机号")
                .name(@"pwd")
                .value(@"");
            }])
            .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
                make
                .editable(NO)
                .height(RowHeightDefault)
                .title(@"密码")
                .name(@"referrer")
                .value(@"123456(初始登录密码)");
            }]);
        }])
        .addToSuperView(self.view);
    }];

    [self.formView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(self.view);
        make.top.equalTo(self.view).mas_equalTo(NAVIGATION_BAR_HEIGHT + 10);
        make.height.mas_equalTo(208);
    }];
    self.formView.scrollEnabled = NO;
    LKBaseButton *bottomButton = [LKBaseButton buttonWithFrame:CGRectZero type:UIButtonTypeCustom title:@"新增员工" titleColor:[UIColor whiteColor] layercorne:25 font:[UIFont fontWithName:@"PingFangSC-Medium" size:18] backgroudColor:yellowDefaultColor AndActionBlock:^(UIButton * _Nonnull btn) {
    }];
    [self.view addSubview:bottomButton];
    [bottomButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(10);
        make.centerX.equalTo(self.view);
        make.top.equalTo(self.formView.mas_bottom).offset(10);
        make.height.mas_equalTo(50);
    }];
    // Do any additional setup after loading the view.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
